<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
</head>
<body>
    <form action="/Register" method="post">
        用户名：<input name="username"><br>
        密码：<input name="password" id="pwd"><br>
        确认密码：<input id="repwd"><br>
        邮箱：<input name="email"><br>
        手机号：<input name="phone"><br>
        性别：<input type="radio" name="sex" value="0">男<input type="radio" name="sex" value="1">女<br>
        <button type="submit" onclick="return checkPwd()">提交</button>
    </form>

    <script>
        function checkPwd(){
            var pwd = document.getElementById("pwd").value
            var repwd = document.getElementById("repwd").value
            if (pwd !== repwd) {
                alert("两次密码不一致")
                return false
            }else{ return true }
        }
    </script>
</body>
</html>